package com.sojson.controller.po.param.verify;

import com.sojson.entity.po.ActivityUser;
import com.sojson.result.Result;
import com.sojson.util.StringUtil;

/**
 * ActivityUser参数验证
 * 
 * @author liu
 * @date 2021-03-16
 */
public class ActivityUserParamVerify {

    /**
     * 单条插入
     * 
     * @param activityUser
     * @return
     */
    public static Result<Integer> insert(ActivityUser activityUser) {
        if (StringUtil.isBlank(activityUser.getActivityNo())) {
            return Result.fail("活动编号不能为空！");
        }
        if (StringUtil.isBlank(activityUser.getUserNo())) {
            return Result.fail("用户编号不能为空！");
        }

        return Result.success();
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param activityUser
     * @return
     */
    public static Result<Integer> updateById(ActivityUser activityUser) {
        if (StringUtil.isBlank(activityUser.getId())) {
            return Result.fail("ID不能为空！");
        }

        return Result.success();
    }

}